<script setup lang="ts">
import { ArrowLeftBold, ArrowRight } from '@element-plus/icons-vue'
import { Male, Female, ArrowRightBold } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router';
const router = useRouter()
import { ref } from 'vue'
let user = ref(JSON.parse(localStorage.getItem('user') || '{}'));
</script>
<template>
    <div id="userinfo">
        <div class="top">
            <el-icon @click="router.back()">
                <ArrowLeftBold />
            </el-icon>
            <h3 style="margin: 0 auto">个人信息</h3>
        </div>
        <main>
            <ul>
                <li class="b">
                    <p>头像</p>
                    <div>
                        <img style="width: 50px;height: 50px;border-radius: 50%;" src="../assets//头像.png" alt="">
                    </div>
                </li>
                <li class="a">
                    <p>昵称</p>
                    <p>{{ user.name }}</p>
                </li>
                <li class="a">
                    <p>性别</p>
                    <div style="display: flex;" >
                        <div style="margin-right: 10px;">
                            <el-icon :style="user.sex == 1 ? 'color:#00BE8C' : 'color:gray'">
                                <Male />
                            </el-icon>
                            <span :style="user.sex == 1 ? 'color:#00BE8C' : 'color:gray'">男士</span>
                        </div>

                        <div>
                            <el-icon :style="user.sex == 0 ? 'color:#00BE8C' : 'color:gray'">
                                <Female />
                            </el-icon>
                            <span :style="user.sex == 0 ? 'color:#00BE8C' : 'color:gray'">女士</span>
                        </div>
                    </div>
                </li>
            </ul>
        </main>
    </div>
</template>



<style scoped lang="scss">
#userinfo {
    width: 100%;
    height: 100%;

    .top {
        width: 100%;
        height: 30px;
        display: flex;
        align-items: center;
        background-color: #fff;
    }

    main {
        width: 100%;
        height: 200px;
        background-color: #fff;
        margin-top: 10px;
        ul {
            width: 100%;
            list-style: none;
            .b {
                width: 100%;
                height: 80px;
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin-bottom: 10px;
            }
            .a {
                width: 100%;
                height: 50px;
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin-bottom: 5px;
            }
        }
    }
}
</style>